import shutil, os, zipfile
from random import Random

name2 = "kaosjo"


def getName():
    print( "开心麻花" )


def nameFild(name):
    print( name + "开始" )


def collatz(nubme):
    if nubme % 2 == 0:
        return nubme // 2
    else:
        return 3 * nubme + 1


def random_str(randomlength=20):
    str = ''
    chars = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789'
    length = len( chars ) - 1
    random = Random()
    for i in range( randomlength ):
        if i % 4 == 0 and i != 0:
            str += "-"
        else:
            str += chars[random.randint( 0, length )]

    return str


def name():
    name = ['张胜', 'base', 'kaixin']

    print( name[:2] )
    print( len( name ) )
    name1 = ['chaoshi', 'kaixin', 'niaho']
    name2 = name + name1
    print( name2[:] )
    index = name2.index( 'kaixin' )
    for name in name2:
        print( name )
    print( index )
    name2.append( 'jdk' )
    print( name2[:] )
    name2.insert( 2, 'chidingcaihong' )
    print( name2[:] )
    name2.sort()
    print( name2 )


def fileDemo():
    os.chdir( "/Users/xuyihang/code/images" )
    shutil.copy( "/Users/xuyihang/code/images/demo.txt", "/Users/xuyihang/code/images/demo2.txt" )


if __name__ == '__main__':
    # s = input()
    # name = "hcuangain";
    # i = len( name )
    # print( i )
    # # print(s)
    # print( "qqq" )
    # spen = 0
    # while spen < 5:
    #     print( 'Hello world' )
    #     spen = spen + 1
    # getName()
    # nameFild( "小心麻花" )
    # print( name2 )
    # collatz1 = collatz( 2 )
    # print(collatz1)
    # name()
    # fileDemo()
    s = random_str()
    print( s )
